package edu.hcmus.sow.domain;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import org.codehaus.jackson.annotate.JsonIgnore;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllUsers", query = "select myUser from User myUser"),
		@NamedQuery(name = "findUserByEnabled", query = "select myUser from User myUser where myUser.enabled = ?1"),
		@NamedQuery(name = "findUserById", query = "select myUser from User myUser where myUser.id = ?1"),
		@NamedQuery(name = "findUserByPassword", query = "select myUser from User myUser where myUser.password = ?1"),
		@NamedQuery(name = "findUserByPasswordContaining", query = "select myUser from User myUser where myUser.password like ?1"),
		@NamedQuery(name = "findUserByPrimaryKey", query = "select myUser from User myUser where myUser.id = ?1"),
		@NamedQuery(name = "findUserByUsername", query = "select myUser from User myUser where myUser.username = ?1"),
		@NamedQuery(name = "findUserByUsernameContaining", query = "select myUser from User myUser where myUser.username like ?1") })
@Table(catalog = "sow", name = "user")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "SharedOnlineWorkspace/edu/hcmus/sow/domain", name = "User")
@XmlRootElement(namespace = "SharedOnlineWorkspace/edu/hcmus/sow/domain")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */

	@Column(name = "ID", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@XmlElement
	Integer id;
	/**
	 */

	@Column(name = "USERNAME", length = 50, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String username;
	/**
	 */

	@Column(name = "PASSWORD", length = 100, nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String password;
	/**
	 */

	@Column(name = "ENABLED", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	Boolean enabled;

	/**
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns({ @JoinColumn(name = "CLIENT_ID", referencedColumnName = "ID") })
	@XmlTransient
	Client client;
	/**
	 */
	@OneToMany(mappedBy = "userByUserId", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserProfile> userProfilesForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Group> groupsForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Task> tasksForAssignedTo;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.FileRevision> fileRevisionsForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TopicPollUser> topicPollUsers;
	/**
	 */
	@OneToMany(mappedBy = "userByUserId", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserProfile> userProfilesForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByUserId", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserProfile> userProfilesForUserId;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskStatus> taskStatusesForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Client> clientsForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskAttachment> taskAttachments;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskCategory> taskCategoriesForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.ProjectMember> projectMembers;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.FileRevision> fileRevisionsForApprovedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserGroup> userGroups;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Topic> topics;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Forum> forumsForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Repository> repositoriesForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserActivity> userActivities;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Folder> foldersForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserPreference> userPreferences;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Forum> forumsForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskCategory> taskCategoriesForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskWorkLog> taskWorkLogs;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskStatus> taskStatusesForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Task> tasksForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Task> tasksForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Group> groupsForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Project> projectsForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TaskComment> taskComments;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Project> projectsForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Repository> repositoriesForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.UserAuthorities> userAuthoritieses;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.TopicComment> topicComments;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Folder> foldersForCreatedBy;
	/**
	 */
	@OneToMany(mappedBy = "userByCreatedBy", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Client> clientsForUpdatedBy;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.MeetingRecipient> meetingRecipients;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Meeting> meetings;
	/**
	 */
	@OneToMany(mappedBy = "user", cascade = { CascadeType.REMOVE }, fetch = FetchType.LAZY)
	@XmlElement(name = "", namespace = "")
	java.util.Set<edu.hcmus.sow.domain.Site> sites;

	/**
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 */
	public Integer getId() {
		return this.id;
	}

	/**
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 */
	public String getUsername() {
		return this.username;
	}

	/**
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 */
	public String getPassword() {
		return this.password;
	}

	/**
	 */
	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	/**
	 */
	public Boolean getEnabled() {
		return this.enabled;
	}

	/**
	 */
	public void setClient(Client client) {
		this.client = client;
	}

	/**
	 */
	@JsonIgnore
	public Client getClient() {
		return client;
	}

	/**
	 */
	public void setUserProfilesForCreatedBy(Set<UserProfile> userProfilesForCreatedBy) {
		this.userProfilesForCreatedBy = userProfilesForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserProfile> getUserProfilesForCreatedBy() {
		if (userProfilesForCreatedBy == null) {
			userProfilesForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>();
		}
		return userProfilesForCreatedBy;
	}

	/**
	 */
	public void setGroupsForCreatedBy(Set<Group> groupsForCreatedBy) {
		this.groupsForCreatedBy = groupsForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Group> getGroupsForCreatedBy() {
		if (groupsForCreatedBy == null) {
			groupsForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Group>();
		}
		return groupsForCreatedBy;
	}

	/**
	 */
	public void setTasksForAssignedTo(Set<Task> tasksForAssignedTo) {
		this.tasksForAssignedTo = tasksForAssignedTo;
	}

	/**
	 */
	@JsonIgnore
	public Set<Task> getTasksForAssignedTo() {
		if (tasksForAssignedTo == null) {
			tasksForAssignedTo = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>();
		}
		return tasksForAssignedTo;
	}

	/**
	 */
	public void setFileRevisionsForCreatedBy(Set<FileRevision> fileRevisionsForCreatedBy) {
		this.fileRevisionsForCreatedBy = fileRevisionsForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<FileRevision> getFileRevisionsForCreatedBy() {
		if (fileRevisionsForCreatedBy == null) {
			fileRevisionsForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.FileRevision>();
		}
		return fileRevisionsForCreatedBy;
	}

	/**
	 */
	public void setTopicPollUsers(Set<TopicPollUser> topicPollUsers) {
		this.topicPollUsers = topicPollUsers;
	}

	/**
	 */
	@JsonIgnore
	public Set<TopicPollUser> getTopicPollUsers() {
		if (topicPollUsers == null) {
			topicPollUsers = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TopicPollUser>();
		}
		return topicPollUsers;
	}

	/**
	 */
	public void setUserProfilesForUpdatedBy(Set<UserProfile> userProfilesForUpdatedBy) {
		this.userProfilesForUpdatedBy = userProfilesForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserProfile> getUserProfilesForUpdatedBy() {
		if (userProfilesForUpdatedBy == null) {
			userProfilesForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>();
		}
		return userProfilesForUpdatedBy;
	}

	/**
	 */
	public void setUserProfilesForUserId(Set<UserProfile> userProfilesForUserId) {
		this.userProfilesForUserId = userProfilesForUserId;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserProfile> getUserProfilesForUserId() {
		if (userProfilesForUserId == null) {
			userProfilesForUserId = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>();
		}
		return userProfilesForUserId;
	}

	/**
	 */
	public void setTaskStatusesForCreatedBy(Set<TaskStatus> taskStatusesForCreatedBy) {
		this.taskStatusesForCreatedBy = taskStatusesForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskStatus> getTaskStatusesForCreatedBy() {
		if (taskStatusesForCreatedBy == null) {
			taskStatusesForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskStatus>();
		}
		return taskStatusesForCreatedBy;
	}

	/**
	 */
	public void setClientsForCreatedBy(Set<Client> clientsForCreatedBy) {
		this.clientsForCreatedBy = clientsForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Client> getClientsForCreatedBy() {
		if (clientsForCreatedBy == null) {
			clientsForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Client>();
		}
		return clientsForCreatedBy;
	}

	/**
	 */
	public void setTaskAttachments(Set<TaskAttachment> taskAttachments) {
		this.taskAttachments = taskAttachments;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskAttachment> getTaskAttachments() {
		if (taskAttachments == null) {
			taskAttachments = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskAttachment>();
		}
		return taskAttachments;
	}

	/**
	 */
	public void setTaskCategoriesForUpdatedBy(Set<TaskCategory> taskCategoriesForUpdatedBy) {
		this.taskCategoriesForUpdatedBy = taskCategoriesForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskCategory> getTaskCategoriesForUpdatedBy() {
		if (taskCategoriesForUpdatedBy == null) {
			taskCategoriesForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskCategory>();
		}
		return taskCategoriesForUpdatedBy;
	}

	/**
	 */
	public void setProjectMembers(Set<ProjectMember> projectMembers) {
		this.projectMembers = projectMembers;
	}

	/**
	 */
	@JsonIgnore
	public Set<ProjectMember> getProjectMembers() {
		if (projectMembers == null) {
			projectMembers = new java.util.LinkedHashSet<edu.hcmus.sow.domain.ProjectMember>();
		}
		return projectMembers;
	}

	/**
	 */
	public void setFileRevisionsForApprovedBy(Set<FileRevision> fileRevisionsForApprovedBy) {
		this.fileRevisionsForApprovedBy = fileRevisionsForApprovedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<FileRevision> getFileRevisionsForApprovedBy() {
		if (fileRevisionsForApprovedBy == null) {
			fileRevisionsForApprovedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.FileRevision>();
		}
		return fileRevisionsForApprovedBy;
	}

	/**
	 */
	public void setUserGroups(Set<UserGroup> userGroups) {
		this.userGroups = userGroups;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserGroup> getUserGroups() {
		if (userGroups == null) {
			userGroups = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserGroup>();
		}
		return userGroups;
	}

	/**
	 */
	public void setTopics(Set<Topic> topics) {
		this.topics = topics;
	}

	/**
	 */
	@JsonIgnore
	public Set<Topic> getTopics() {
		if (topics == null) {
			topics = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Topic>();
		}
		return topics;
	}

	/**
	 */
	public void setForumsForUpdatedBy(Set<Forum> forumsForUpdatedBy) {
		this.forumsForUpdatedBy = forumsForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Forum> getForumsForUpdatedBy() {
		if (forumsForUpdatedBy == null) {
			forumsForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Forum>();
		}
		return forumsForUpdatedBy;
	}

	/**
	 */
	public void setRepositoriesForUpdatedBy(Set<Repository> repositoriesForUpdatedBy) {
		this.repositoriesForUpdatedBy = repositoriesForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Repository> getRepositoriesForUpdatedBy() {
		if (repositoriesForUpdatedBy == null) {
			repositoriesForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Repository>();
		}
		return repositoriesForUpdatedBy;
	}

	/**
	 */
	public void setUserActivities(Set<UserActivity> userActivities) {
		this.userActivities = userActivities;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserActivity> getUserActivities() {
		if (userActivities == null) {
			userActivities = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserActivity>();
		}
		return userActivities;
	}

	/**
	 */
	public void setFoldersForUpdatedBy(Set<Folder> foldersForUpdatedBy) {
		this.foldersForUpdatedBy = foldersForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Folder> getFoldersForUpdatedBy() {
		if (foldersForUpdatedBy == null) {
			foldersForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Folder>();
		}
		return foldersForUpdatedBy;
	}

	/**
	 */
	public void setUserPreferences(Set<UserPreference> userPreferences) {
		this.userPreferences = userPreferences;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserPreference> getUserPreferences() {
		if (userPreferences == null) {
			userPreferences = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserPreference>();
		}
		return userPreferences;
	}

	/**
	 */
	public void setForumsForCreatedBy(Set<Forum> forumsForCreatedBy) {
		this.forumsForCreatedBy = forumsForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Forum> getForumsForCreatedBy() {
		if (forumsForCreatedBy == null) {
			forumsForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Forum>();
		}
		return forumsForCreatedBy;
	}

	/**
	 */
	public void setTaskCategoriesForCreatedBy(Set<TaskCategory> taskCategoriesForCreatedBy) {
		this.taskCategoriesForCreatedBy = taskCategoriesForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskCategory> getTaskCategoriesForCreatedBy() {
		if (taskCategoriesForCreatedBy == null) {
			taskCategoriesForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskCategory>();
		}
		return taskCategoriesForCreatedBy;
	}

	/**
	 */
	public void setTaskWorkLogs(Set<TaskWorkLog> taskWorkLogs) {
		this.taskWorkLogs = taskWorkLogs;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskWorkLog> getTaskWorkLogs() {
		if (taskWorkLogs == null) {
			taskWorkLogs = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskWorkLog>();
		}
		return taskWorkLogs;
	}

	/**
	 */
	public void setTaskStatusesForUpdatedBy(Set<TaskStatus> taskStatusesForUpdatedBy) {
		this.taskStatusesForUpdatedBy = taskStatusesForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskStatus> getTaskStatusesForUpdatedBy() {
		if (taskStatusesForUpdatedBy == null) {
			taskStatusesForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskStatus>();
		}
		return taskStatusesForUpdatedBy;
	}

	/**
	 */
	public void setTasksForUpdatedBy(Set<Task> tasksForUpdatedBy) {
		this.tasksForUpdatedBy = tasksForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Task> getTasksForUpdatedBy() {
		if (tasksForUpdatedBy == null) {
			tasksForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>();
		}
		return tasksForUpdatedBy;
	}

	/**
	 */
	public void setTasksForCreatedBy(Set<Task> tasksForCreatedBy) {
		this.tasksForCreatedBy = tasksForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Task> getTasksForCreatedBy() {
		if (tasksForCreatedBy == null) {
			tasksForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>();
		}
		return tasksForCreatedBy;
	}

	/**
	 */
	public void setGroupsForUpdatedBy(Set<Group> groupsForUpdatedBy) {
		this.groupsForUpdatedBy = groupsForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Group> getGroupsForUpdatedBy() {
		if (groupsForUpdatedBy == null) {
			groupsForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Group>();
		}
		return groupsForUpdatedBy;
	}

	/**
	 */
	public void setProjectsForCreatedBy(Set<Project> projectsForCreatedBy) {
		this.projectsForCreatedBy = projectsForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Project> getProjectsForCreatedBy() {
		if (projectsForCreatedBy == null) {
			projectsForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Project>();
		}
		return projectsForCreatedBy;
	}

	/**
	 */
	public void setTaskComments(Set<TaskComment> taskComments) {
		this.taskComments = taskComments;
	}

	/**
	 */
	@JsonIgnore
	public Set<TaskComment> getTaskComments() {
		if (taskComments == null) {
			taskComments = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskComment>();
		}
		return taskComments;
	}

	/**
	 */
	public void setProjectsForUpdatedBy(Set<Project> projectsForUpdatedBy) {
		this.projectsForUpdatedBy = projectsForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Project> getProjectsForUpdatedBy() {
		if (projectsForUpdatedBy == null) {
			projectsForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Project>();
		}
		return projectsForUpdatedBy;
	}

	/**
	 */
	public void setRepositoriesForCreatedBy(Set<Repository> repositoriesForCreatedBy) {
		this.repositoriesForCreatedBy = repositoriesForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Repository> getRepositoriesForCreatedBy() {
		if (repositoriesForCreatedBy == null) {
			repositoriesForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Repository>();
		}
		return repositoriesForCreatedBy;
	}

	/**
	 */
	public void setUserAuthoritieses(Set<UserAuthorities> userAuthoritieses) {
		this.userAuthoritieses = userAuthoritieses;
	}

	/**
	 */
	@JsonIgnore
	public Set<UserAuthorities> getUserAuthoritieses() {
		if (userAuthoritieses == null) {
			userAuthoritieses = new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserAuthorities>();
		}
		return userAuthoritieses;
	}

	/**
	 */
	public void setTopicComments(Set<TopicComment> topicComments) {
		this.topicComments = topicComments;
	}

	/**
	 */
	@JsonIgnore
	public Set<TopicComment> getTopicComments() {
		if (topicComments == null) {
			topicComments = new java.util.LinkedHashSet<edu.hcmus.sow.domain.TopicComment>();
		}
		return topicComments;
	}

	/**
	 */
	public void setFoldersForCreatedBy(Set<Folder> foldersForCreatedBy) {
		this.foldersForCreatedBy = foldersForCreatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Folder> getFoldersForCreatedBy() {
		if (foldersForCreatedBy == null) {
			foldersForCreatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Folder>();
		}
		return foldersForCreatedBy;
	}

	/**
	 */
	public void setClientsForUpdatedBy(Set<Client> clientsForUpdatedBy) {
		this.clientsForUpdatedBy = clientsForUpdatedBy;
	}

	/**
	 */
	@JsonIgnore
	public Set<Client> getClientsForUpdatedBy() {
		if (clientsForUpdatedBy == null) {
			clientsForUpdatedBy = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Client>();
		}
		return clientsForUpdatedBy;
	}

	/**
	 */
	public void setMeetingRecipients(Set<MeetingRecipient> meetingRecipients) {
		this.meetingRecipients = meetingRecipients;
	}

	/**
	 */
	@JsonIgnore
	public Set<MeetingRecipient> getMeetingRecipients() {
		if (meetingRecipients == null) {
			meetingRecipients = new java.util.LinkedHashSet<edu.hcmus.sow.domain.MeetingRecipient>();
		}
		return meetingRecipients;
	}

	/**
	 */
	public void setMeetings(Set<Meeting> meetings) {
		this.meetings = meetings;
	}

	/**
	 */
	@JsonIgnore
	public Set<Meeting> getMeetings() {
		if (meetings == null) {
			meetings = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Meeting>();
		}
		return meetings;
	}

	/**
	 */
	public void setSites(Set<Site> sites) {
		this.sites = sites;
	}

	/**
	 */
	@JsonIgnore
	public Set<Site> getSites() {
		if (sites == null) {
			sites = new java.util.LinkedHashSet<edu.hcmus.sow.domain.Site>();
		}
		return sites;
	}

	/**
	 */
	public User() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(User that) {
		setId(that.getId());
		setUsername(that.getUsername());
		setPassword(that.getPassword());
		setEnabled(that.getEnabled());
		setClient(that.getClient());
		setUserProfilesForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>(that.getUserProfilesForCreatedBy()));
		setGroupsForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Group>(that.getGroupsForCreatedBy()));
		setTasksForAssignedTo(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>(that.getTasksForAssignedTo()));
		setFileRevisionsForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.FileRevision>(that.getFileRevisionsForCreatedBy()));
		setTopicPollUsers(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TopicPollUser>(that.getTopicPollUsers()));
		setUserProfilesForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>(that.getUserProfilesForUpdatedBy()));
		setUserProfilesForUserId(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserProfile>(that.getUserProfilesForUserId()));
		setTaskStatusesForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskStatus>(that.getTaskStatusesForCreatedBy()));
		setClientsForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Client>(that.getClientsForCreatedBy()));
		setTaskAttachments(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskAttachment>(that.getTaskAttachments()));
		setTaskCategoriesForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskCategory>(that.getTaskCategoriesForUpdatedBy()));
		setProjectMembers(new java.util.LinkedHashSet<edu.hcmus.sow.domain.ProjectMember>(that.getProjectMembers()));
		setFileRevisionsForApprovedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.FileRevision>(that.getFileRevisionsForApprovedBy()));
		setUserGroups(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserGroup>(that.getUserGroups()));
		setTopics(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Topic>(that.getTopics()));
		setForumsForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Forum>(that.getForumsForUpdatedBy()));
		setRepositoriesForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Repository>(that.getRepositoriesForUpdatedBy()));
		setUserActivities(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserActivity>(that.getUserActivities()));
		setFoldersForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Folder>(that.getFoldersForUpdatedBy()));
		setUserPreferences(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserPreference>(that.getUserPreferences()));
		setForumsForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Forum>(that.getForumsForCreatedBy()));
		setTaskCategoriesForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskCategory>(that.getTaskCategoriesForCreatedBy()));
		setTaskWorkLogs(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskWorkLog>(that.getTaskWorkLogs()));
		setTaskStatusesForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskStatus>(that.getTaskStatusesForUpdatedBy()));
		setTasksForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>(that.getTasksForUpdatedBy()));
		setTasksForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Task>(that.getTasksForCreatedBy()));
		setGroupsForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Group>(that.getGroupsForUpdatedBy()));
		setProjectsForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Project>(that.getProjectsForCreatedBy()));
		setTaskComments(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TaskComment>(that.getTaskComments()));
		setProjectsForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Project>(that.getProjectsForUpdatedBy()));
		setRepositoriesForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Repository>(that.getRepositoriesForCreatedBy()));
		setUserAuthoritieses(new java.util.LinkedHashSet<edu.hcmus.sow.domain.UserAuthorities>(that.getUserAuthoritieses()));
		setTopicComments(new java.util.LinkedHashSet<edu.hcmus.sow.domain.TopicComment>(that.getTopicComments()));
		setFoldersForCreatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Folder>(that.getFoldersForCreatedBy()));
		setClientsForUpdatedBy(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Client>(that.getClientsForUpdatedBy()));
		setMeetingRecipients(new java.util.LinkedHashSet<edu.hcmus.sow.domain.MeetingRecipient>(that.getMeetingRecipients()));
		setMeetings(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Meeting>(that.getMeetings()));
		setSites(new java.util.LinkedHashSet<edu.hcmus.sow.domain.Site>(that.getSites()));
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("id=[").append(id).append("] ");
		buffer.append("username=[").append(username).append("] ");
		buffer.append("password=[").append(password).append("] ");
		buffer.append("enabled=[").append(enabled).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((id == null) ? 0 : id.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof User))
			return false;
		User equalCheck = (User) obj;
		if ((id == null && equalCheck.id != null) || (id != null && equalCheck.id == null))
			return false;
		if (id != null && !id.equals(equalCheck.id))
			return false;
		return true;
	}
}
